package com.cloud.code.牛客网;

import java.util.Scanner;

public class Test52 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String line = in.nextLine()
                .replaceAll(",", "");
        char[] sites = line.toCharArray();
        in.close();

        int max = 0;

        for (int i = 0; i < sites.length; i++) {
            char cur_site = sites[i];
            if (cur_site == '0') {
                int pre = line.indexOf('1', i);
                int suf = line.lastIndexOf('1', i);
                if (pre == -1) pre = 100;
                if (suf == -1) suf = line.length() - 1;
                int min = Math.min(pre - i, i - suf);
                if (min > max) max = min;
            }
        }

        System.out.println(max);

    }
}
